﻿using Module = MicroCloud.Authorization.Entities.Module;

namespace MicroCloud.Authorization
{
    /// <summary>
    /// 功能权限模块
    /// </summary>
    [Description("功能权限模块")]
    [DependsOnPacks(typeof(IdentityPack), typeof(MvcFunctionPack))]
    public class FunctionAuthorizationPack
        : FunctionAuthorizationPackBase<FunctionAuthManager, FunctionAuthorization, FunctionAuthCache, ModuleHandler, Function,
            FunctionInputDto, Module, ModuleInputDto, long, ModuleFunction, ModuleRole, ModuleUser, long, long>
    {
        /// <summary>
        /// 将模块服务添加到依赖注入服务容器中
        /// </summary>
        /// <param name="services">依赖注入服务容器</param>
        /// <returns></returns>
        public override IServiceCollection AddServices(IServiceCollection services)
        {
            base.AddServices(services);

            services.AddScoped<IAuthorityService, AuthorityService>();

            services.AddSingleton<ISeedDataInitializer, ModuleSeedDataInitializer>();

            return services;
        }

    }
}
